﻿namespace Probel.PersonalNotes.Models.Home
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;
    using System.ComponentModel.DataAnnotations.Schema;
    using System.Linq;
    using System.Web;

    [Table("Events")]
    public class RecordViewModel
    {
        #region Constructors

        public RecordViewModel()
        {
            this.EventDate = DateTime.Today;
        }

        #endregion Constructors

        #region Properties

        [Required(ErrorMessage = "Champ requis")]
        [DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = true)]
        [DataType(DataType.Date)]
        public DateTime EventDate
        {
            get;
            set;
        }

        [Required(ErrorMessage = "Champ requis")]
        [StringLength(3, MinimumLength = 2, ErrorMessage = "Le nom de l'évènement doit faire entre deux et trois caractères")]
        public string EventName
        {
            get;
            set;
        }

        [Key]
        public int Id
        {
            get;
            set;
        }

        [Required]
        public bool IsDoubloon
        {
            get;
            set;
        }

        public string Result
        {
            get;
            set;
        }

        #endregion Properties
    }
}